package old_Core;

import MathCore.Real;



public class StkElem extends Object
{
	public Real r = new Real();
	public Matrix matrix;
	public String s="";
	public char type=' ';
    public int point=0;
	public int position=0;

	private static Real.NumberFormat format = new Real.NumberFormat();
        
    public StkElem(){}
	
	public StkElem(Matrix m)
	{
		matrix = m;
		type='m';
		r.assign(Real.NAN);

		format.maxwidth = 8;
	}
        
    public void set(StkElem e)
	{
		r.assign(e.r);
        type=e.type;
        point=e.point;
        s=e.s;
		matrix = e.matrix;
     }

	public StkElem(Real n)
	{
		r.assign(n);
		type='n';
	}
	
	public StkElem(int n)
	{
		r.assign(n);
		type='n';
	}

	public StkElem(char t, String o)
	{
		s=o;
		type=t;
	}
	
	public StkElem(char t, String o, Real r)
	{
		s=o;
		type=t;
		this.r.assign(r);
	}
        
    public StkElem(StkElem e)
	{
          r.assign(e.r);
          s=e.s;
          type=e.type;
    }

	public String toString()
	{
		if(type=='n') return r.toString(format);
		else return s;
	}
        
}
